# 任务
from ronglian_sms_sdk import SmsSDK
from celery_tasks.main import celery_app
#函数要让celery的实例的task装饰器 装饰
#需要celery自动检测指定包的任务
@celery_app.task
def celery_send_smd_task(phonenumber,sms_code):

    accId = '2c94811c946f6bfb01965401356e56b8'
    accToken = '500c1d8981184c59b60568ccf92f10e1'
    appId = '2c94811c946f6bfb01965401372256bf'
    sdk = SmsSDK(accId, accToken, appId)
    tid = '1'
    mobile = phonenumber
    datas = (sms_code, '5')
    sdk.sendMessage(tid, mobile, datas)
